﻿<sdk:ChildWindow x:Class="Ewav.AddEditOrganization"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"	
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
            xmlns:local="clr-namespace:Ewav"
            mc:Ignorable="d"     
                 xmlns:controls ="clr-namespace:System.Windows.Automation.Peers;assembly=System.Windows.Controls"
           Title="Edit Organization" VerticalAlignment="Center" HorizontalAlignment="Center"           >
    <sdk:ChildWindow.Style>
        <StaticResource ResourceKey="ChildWindowStyle1"/>
    </sdk:ChildWindow.Style>
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
    	<StackPanel Margin="10,0,0,0" Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top">
    		<StackPanel x:Name="spOrganizationEdit" HorizontalAlignment="Left"   Margin="0,8,0,0" VerticalAlignment="Top" >
                 
					<!--<StackPanel x:Name="spMsg" VerticalAlignment="Top" Orientation="Horizontal" Background="#FFF1CAC2" Margin="0,9,0,18">
                    <Image HorizontalAlignment="Left" Height="20" Source="../../images/ErrorD.png" Stretch="Fill" Width="20" VerticalAlignment="Center" Margin="10,6,0,6"/>
                    <TextBlock TextWrapping="Wrap" x:Name="tbMessage" Text="The email or password you entered is incorrect." FontFamily="Segoe UI" Foreground="#FF601919" Margin="6,6,0,6" FontSize="13.333" FontWeight="Normal" VerticalAlignment="Center"/>
                </StackPanel>-->
                
                <StackPanel x:Name="spMsg" VerticalAlignment="Top" Orientation="Horizontal" Margin="0,0,0,20" Background="#FFF1CAC2" Visibility="Collapsed">
    				<Image HorizontalAlignment="Left" Height="20" Source="../../images/ErrorD.png" Stretch="Fill" Width="20" VerticalAlignment="Center" Margin="9,6,0,6"/>
    				<TextBlock x:Name="ErrMsg" TextWrapping="Wrap" Text="Please correct the following errors." FontFamily="Segoe UI" Foreground="#FF601919" Margin="6,6,0,6" FontSize="13.333" FontWeight="Normal" VerticalAlignment="Center"/>
    			</StackPanel>
                
                <TextBlock TextWrapping="Wrap" Text="Organization Name:" Width="153" FontFamily="Segoe UI" FontSize="13.333" HorizontalAlignment="Left" Margin="0,8,0,0"/>
    			<TextBox TextWrapping="Wrap" x:Name="tbOrganizationName" Height="30" Width="277"      Text="{Binding Name, Mode=TwoWay}"   Margin="134,-22,0,0" HorizontalAlignment="Left"/>
    			<TextBlock TextWrapping="Wrap" Text="Active:" Width="153" FontFamily="Segoe UI" FontSize="13.333" HorizontalAlignment="Left" Margin="0,13,0,0"/>
    			<ComboBox Width="155" x:Name="cboActive" Height="30" HorizontalAlignment="Left" Margin="134,-20,0,0">
    				<ComboBoxItem Content="Yes"/>
    				<ComboBoxItem Content="No"/>
    			</ComboBox>
    			<StackPanel x:Name="spAddAdmin" HorizontalAlignment="Left" Margin="0,7,0,0" VerticalAlignment="Top" Width="460" >
    				<TextBlock x:Name="txtOrgAdmin" TextWrapping="Wrap" Text="Organization Administrator:" Width="254" FontFamily="Segoe UI" FontSize="16" HorizontalAlignment="Left"/>
    				<!--<Grid x:Name="grdEmail" Height="72" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,0,0,0">
    					<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" FontFamily="Segoe UI" FontSize="12" FontWeight="Normal" Foreground="#FF625F5F" Width="432" VerticalAlignment="Top"><Run Text="Enter the email address of the user you want to add to your organization."/><LineBreak/><Run Text="Type in the first 3 characters to select from users that are already in the system."/></TextBlock>
    					<TextBlock HorizontalAlignment="Left" Margin="0,0,0,5" TextWrapping="Wrap" Text="Email:" FontFamily="Segoe UI" FontSize="13.333" FontWeight="Bold" d:LayoutOverrides="HorizontalAlignment" VerticalAlignment="Bottom"/>

    					<sdk:AutoCompleteBox x:Name="autoEmail" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="167,42,0,0" Height="30" Width="203" IsTextCompletionEnabled="True"/>
    					<Button x:Name="btnSearch" HorizontalAlignment="Right" Click="btnSearch_Click" VerticalAlignment="Bottom" Margin="0,0,27,0" Height="30" Width="30">
    						<Image Source="../../Images/search.png" Stretch="Fill"/>
    					</Button>
    				</Grid>-->

                    <Grid x:Name="grdWindows" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,39,0,0">
                        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Email Address:" Width="153" FontFamily="Segoe UI" FontSize="13.333" d:LayoutOverrides="HorizontalAlignment, Height" VerticalAlignment="Top" Margin="8,-20,0,0"/>
                        <TextBox x:Name="tbEmailAddress" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="134,-25,20,0" Height="30" Width="220" Text="{Binding EmailAddress, Mode=TwoWay}" KeyDown="btnSearch_KeyDown" />
                        <Button x:Name="btnSearch" Width="32" Click="btnSearch_Click" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="364,-26,0,0" Height="32" Padding="2" Style="{StaticResource btnprimary}" >
                        	<Image Source="/Ewav;component/Images/search.png" Stretch="Fill" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Button>
                        <TextBox x:Name="tbUserId" Visibility="Collapsed" Text="{Binding UserName, Mode=TwoWay}" />
                    </Grid>
                    <Grid x:Name="grdForms" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,40,0,0" Visibility="Collapsed">
                        <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Email Address:" Width="153" VerticalAlignment="Top" Margin="8,-20,0,0" d:LayoutOverrides="HorizontalAlignment"/>
                        <sdk:AutoCompleteBox x:Name="autoEmail" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="134,-25,20,0" Height="30" Width="262" Text="{Binding UserName, Mode=TwoWay}" DropDownClosed="autoEmail_DropDownClosed" />
                    </Grid> 
                    <Grid x:Name="grdUserId" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,0,0,0" Visibility="Collapsed">

                            <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" FontFamily="Segoe UI" FontSize="12" FontWeight="Normal" Foreground="#FF625F5F" Width="432" VerticalAlignment="Top" Text="To add a user to your organization, enter the UserId and click the Search button."/>
                            <TextBlock HorizontalAlignment="Left" Margin="0,30,0,5" TextWrapping="Wrap" Text="User Id:" FontFamily="Segoe UI" FontSize="13.333" FontWeight="Bold" d:LayoutOverrides="HorizontalAlignment" VerticalAlignment="Top" RenderTransformOrigin="0.842,-1.207"/>
                            <TextBox   x:Name="tbUserID"          Text="{Binding FirstName, Mode=TwoWay}"      Margin="167,24,0,0" TextWrapping="Wrap" Height="30" Width="220" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                            <Button HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,4,0" Height="30" Width="30">
                                <Image Source="../../Images/search.png" Stretch="Fill"/>
                            </Button>
                    </Grid>
    				<StackPanel x:Name="spUser" HorizontalAlignment="Left" VerticalAlignment="Top">
    					<TextBlock HorizontalAlignment="Left" Margin="8,17,0,0" TextWrapping="Wrap" Text="First Name:" Width="153" FontFamily="Segoe UI" FontSize="13.333"/>
    					<TextBox   x:Name="tbFirstName"          Text="{Binding FirstName, Mode=TwoWay}"      Margin="134,-22,20,0" TextWrapping="Wrap" Height="30" Width="262" HorizontalAlignment="Left" VerticalAlignment="Top"/>
    					<TextBlock HorizontalAlignment="Left" Margin="8,17,0,0" TextWrapping="Wrap" Text="Last Name:" Width="153" FontFamily="Segoe UI" FontSize="13.333"/>
    					<TextBox x:Name="tbLastName"  Margin="134,-24,20,0"       Text="{Binding LastName, Mode=TwoWay}"   TextWrapping="Wrap" Height="30" Width="262" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                        
    					<!--<Button x:Name="btnSaveUserDetails" Content="Save" Click="btnSaveUserDetails_Click"  Margin="6,31,0,0" FontFamily="Segoe UI" FontSize="13.333" Background="#FF63A6DF" Foreground="White" VerticalAlignment="Top" HorizontalAlignment="Left" Width="136" Style="{StaticResource btnstyle1}" Height="30" Padding="5,6"/>
                    <Button x:Name="btnCancelUserDetails" Content="Cancel" Click="btnCancelUserDetails_Click" Margin="357,-30,20,0" FontFamily="Segoe UI" FontSize="13.333" Background="#FFD2D2D2" Foreground="#FF252525" VerticalAlignment="Top" HorizontalAlignment="Left" Width="81" Height="29" Style="{StaticResource btnstyle2}"/>-->
					<!--  <TextBlock HorizontalAlignment="Left" Margin="8,17,0,0" TextWrapping="Wrap" Text="Role:" Width="152" FontFamily="Segoe UI" FontSize="13.333" FontWeight="Bold"/>
                   <ComboBox x:Name="cmbRole"  Height="30" Width="262" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="178,-23,20,0" ItemsSource="{Binding}" SelectionChanged="cmbRole_SelectionChanged" >
                        <ComboBoxItem Name="admin" Content="Administrator"/>
                        <ComboBoxItem Name="user" Content="User"/>
                    </ComboBox>
                    <StackPanel x:Name="spAssignDatasources" >
                        <TextBlock HorizontalAlignment="Left" Margin="8,17,0,0" TextWrapping="Wrap" Text="Associate Data Sources:" Width="212" FontFamily="Segoe UI" FontSize="16" FontWeight="Bold"/>
                        <ListBox x:Name="lbxAvailable" HorizontalAlignment="Left" SelectedIndex="0" Width="160" SelectionMode="Extended" BorderThickness="1" Height="132" VerticalAlignment="Top" Margin="8,6,0,0"/>
                        <Button x:Name="btnAddSource" Content="&gt;&gt;" HorizontalAlignment="Left" Width="49" VerticalAlignment="Top" Margin="194,-112,0,0" Click="btnAddSource_Click" />
                        <Button x:Name="btnRemoveSource" Content="&lt;&lt;" Width="49" HorizontalAlignment="Left"  VerticalAlignment="Top" Margin="194,-55,0,0" Click="btnRemoveSource_Click" />
                        <ListBox x:Name="lbxSelected" HorizontalAlignment="Left" SelectedIndex="0" Width="160" SelectionMode="Single" BorderThickness="1"  Height="132" VerticalAlignment="Top" Margin="277,-132,0,0"  />
                    </StackPanel>-->
    					<TextBlock HorizontalAlignment="Left" Margin="8,17,0,0" TextWrapping="Wrap" Text="Phone:" Width="153" FontFamily="Segoe UI" FontSize="13.333"/>
    					<TextBox  x:Name="tbPhone" Margin="134,-23,20,0" TextWrapping="Wrap"      Text="{Binding Phone, Mode=TwoWay}"    Height="30" Width="262" HorizontalAlignment="Left" VerticalAlignment="Top"/>
    				</StackPanel>
    			</StackPanel>
					<!--<Button Content="Add New Admin" x:Name="btnAddAdmin"     Click="btnAddAdmin_Click"  FontFamily="Segoe UI" FontSize="13.333" Background="#FF63A6DF" Foreground="White" Width="136" Margin="0,20,0,0" HorizontalAlignment="Left" Style="{StaticResource btnstyle1}" Height="30"/>
                <sdk:DataPager PageSize="10" VerticalAlignment="Top" Margin="604,-36,0,0" Background="{x:Null}" HorizontalAlignment="Left"/>
                <sdk:DataGrid x:Name="dgUsers" RowHeight="35" AutoGenerateColumns="False"            DataContext="{Binding}" HorizontalAlignment="Left" MinHeight="100" MaxHeight="250" VerticalAlignment="Top" AreRowGroupHeadersFrozen="False" Margin="0,1,0,0">
                    <sdk:DataGrid.Columns>
                        <sdk:DataGridTextColumn Binding="{Binding FirstName}" Header="First Name" Width="160"/>
                        <sdk:DataGridTextColumn Binding="{Binding LastName}" Header="Last Name" Width="160"/>
                        <sdk:DataGridTextColumn Binding="{Binding Email}" Header="Email" Width="160"/>
                        <sdk:DataGridTextColumn Binding="{Binding Phone}" Header="Phone" Width="160"/>
                        <sdk:DataGridTemplateColumn Width="160" >
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                                        <Button Content="Edit" x:Name="btnEditUsers" Click="btnEditUsers_Click"   FontFamily="Segoe UI" FontSize="13.333" Background="#FF63A6DF" Foreground="White" VerticalAlignment="Top" HorizontalAlignment="Left" d:LayoutOverrides="VerticalAlignment" Width="60" Style="{StaticResource btnstyle1}"/>
                                        <TextBlock Text="" Width="15"/>
                                        <Button Content="Delete" FontFamily="Segoe UI" FontSize="13.333" Background="#FF63A6DF" Foreground="White" VerticalAlignment="Top" HorizontalAlignment="Left" d:LayoutOverrides="VerticalAlignment" Width="60" Style="{StaticResource btnstyle1}" />
                                    </StackPanel>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
                    </sdk:DataGrid.Columns>
                </sdk:DataGrid>
                <TextBlock Height="19" x:Name="tbNoOrgAdminsAdded" TextWrapping="Wrap" Text="No Org Admins have been added." Width="194" HorizontalAlignment="Left" Margin="8,-127,0,0"/>-->
    			<Button x:Name="btnSaveOrgDetails" Content="Save" IsEnabled="True" Width="136" Click="btnSaveOrgDetails_Click"  HorizontalAlignment="Left" Margin="134,16,20,0" Style="{StaticResource btnprimary}" Height="30"/>
    			<Button x:Name="btnCancelOrgDetails" Content="Cancel" HorizontalAlignment="Left" Width="80" Click="btnCancelOrgDetails_Click"  Margin="285,-30,-4,0" Style="{StaticResource btnprimary}" Height="30"/>
    		</StackPanel>
    	</StackPanel>

    </Grid>
</sdk:ChildWindow>